home *** CD-ROM | disk | FTP | other *** search
- Path: news.magick.net!usenet
- From: Shawn Talbert <shawnt@src.usa.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Error Handling in C++
- Date: 17 Mar 1996 05:01:06 GMT
- Organization: SRC Vision
- Message-ID: <4ig6ai$puj@news.magick.net>
- References: <4ibj4h$l0i$1@mhafc.production.compuserve.com>
- NNTP-Posting-Host: ppp8.mfr.magick.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.2N (Windows; I; 32bit)
-
- John Carlyle-Clarke <100615.2651@CompuServe.COM> wrote:
- >Can anyone offer any advice on the following problem?
- >
- > Previously, when using procedural languages, I developed an
- >What I need is for someone to suggest a good method for error
- >handling without inbuilt exceptions that reflects the object
- >oriented nature of the language, or a way of simulating
- >exceptions like the MFC does.
- >
- > John Carlyle-Clarke
-
- I sympathize with you John; "real world" error handling is
- woefully lacking in the texts I've seen...
-
- If you are using Windows NT as your OS, look into the standard
- exception handling built in to the OS. It is not based on C++
- exception handling, so it might be applicable to your design.
-
- Another approach is to define an ERROR object in which error
- status and reporting functionality can reside. If your
- previous C style "error code" functions are converted to
- returning an ERROR object instead of returning simple int's,
- you get a similar programming style yet reap the benefits of
- some OOD in error handling. In this manner, objects
- communicate errors in a standard fashion, and you can enjoy
- some code reuse by building generic error reporting functions
- into the ERROR class (rather than handling errors from scratch
- in each individual object in your system.)
-
-
-
-